

import xml.Message;
import dd.control.AddChoiceResponseController;
import dd.control.AddEdgeResponseController;
import dd.control.ConnectController;
import dd.control.TurnResponseController;
import dd.control.modCreateResponseController;
import dd.control.userSignInResponseController;

public class AnotherHandler extends HandlerBase {

	/**
	 * this handler handle all the response get from server
	 */
	@Override
	public void process(Message response) {
		String type = response.contents.getFirstChild().getLocalName();

		if (type.equals ("connectResponse")) {
			// What happens now that we are connected?
			new ConnectController().process(response);
		}else if(type.equals("signInResponse")){
			new userSignInResponseController().process(response);
		} else if(type.equals("createResponse")){
			new modCreateResponseController().process(response);
		} else if(type.equals("addChoiceResponse")){
			new AddChoiceResponseController().process(response);
		}
		else if(type.equals("addEdgeResponse")){
			new AddEdgeResponseController().process(response);
		}
		else if(type.equals("TurnResponse")){
			new TurnResponseController().process(response);
		}
	//	System.out.println("Really received:" + response);
		
		// continue on to the next one in the chain, as based on superclass behavior
		super.process(response);
	}

}

